import request from '@/utils/request'

// 查询预约列表
export function listBook(query) {
  return request({
    url: '/business/book/list',
    method: 'get',
    params: query
  })
}

// 查询预约详细
export function getBook(id) {
  return request({
    url: '/business/book/' + id,
    method: 'get'
  })
}

// 新增预约
export function addBook(data) {
  return request({
    url: '/business/book',
    method: 'post',
    data: data
  })
}

// 修改预约
export function updateBook(data) {
  return request({
    url: '/business/book',
    method: 'put',
    data: data
  })
}

// 删除预约
export function delBook(id) {
  return request({
    url: '/business/book/' + id,
    method: 'delete'
  })
}

// 导出预约
export function exportBook(query) {
  return request({
    url: '/business/book/export',
    method: 'get',
    params: query
  })
}

//获取当前用户部门
export function getRole(){
  return request({
    url:'/business/book/role',
    method:'get'
  })
}

//取消预约
export function cancelBook(data){
  return request({
    url:'/business/book/cancel',
    method:'put',
    data:data
  })
}

//确认到达
export function confirmBook(data){
  return request({
    url:'/business/book/confirm',
    method:'put',
    data:data
  })
}

//按日期查询剩余名额
export function bookNum(query){
  return request({
    url:'/business/book/bookNum',
    method:'get',
    params:query
  })
}